The present invention relates generally to a MPEG-2 decoder. More specifically, the present invention relates to a MPEG-2 decoder with an embedded contrast enhancement function. Advantageously, corresponding methods and software instructions stored in a memory are also disclosed.
Contrast enhancement is a technique for improving image quality. Linear contrast enhancement is one form of contrast enhancement that has been applied to many image processing systems and methods including MPEG-2 decoding.
Linear contrast enhancement, which is also referred to as contrast stretching, linearly expands the original digital values of the luminance data into a new distribution. It will be appreciated that by expanding the original input values of the image, the total range of sensitivity of the display device can be utilized. Linear contrast enhancement also makes subtle variations within the data, e.g., image, more obvious. In short, contrast stretching is a linear operation, which extends the narrow range of image pixel values over a wider range so that the contrast of the picture can be improved. Equation (1) shows the operation in the spatial domain:output=(input−β)×α  (1) where β is the shifting parameter and α is the stretching factor. It will be appreciated that input and output are the luminance values of the input and output images, respectively.
The various types of linear enhancement algorithms are best applied to images with Gaussian or near-Gaussian histograms, i.e., all the luminance values fall within a narrow range on the histogram and only one mode is apparent. The three methods of linear contrast enhancement generally employed in contrast enhancing images are as follows:    1. Minimum-Maximum Linear Contrast Stretch—Here, the original minimum and maximum values of the luminance data are assigned to a newly specified set of values that utilize the full range of available brightness values. For example, in an image with a minimum brightness value of 45 and a maximum value of 205, given an eight bit range of 0-255, the values of 0 to 44 and 206 to 255 are not displayed when the image is viewed without enhancement. Additional detail in the image can be detected by stretching the minimum value of 45 to 0 and the maximum value of 205 to 255. An algorithm can be used that matches the old minimum value to the new minimum value, and the old maximum value to the new maximum value. All the old intermediate values are scaled proportionately between the new minimum and maximum values. Many digital image processing systems have built-in capabilities that automatically expand the minimum and maximum values to optimize the full range of available brightness values.    2. Percentage Linear Contrast Stretch—This is similar to the minimum-maximum linear contrast stretch except this method uses a specified minimum and maximum values that lie within a certain percentage of pixels of the mean of the histogram. In this particular variation of linear contrast enhancement, a standard deviation from the mean is often used to push the tails of the histogram beyond the original minimum and maximum values.    3. Piecewise Linear Contrast Stretch—When the distribution in a histogram of an image is bi- or tri-modal, it is often desirable to stretch certain values of the histogram for increased enhancement in selected areas. A piecewise linear contrast enhancement involves the identification of a number of linear enhancement steps that expands the brightness ranges in the modes of the histogram. In short, in the piecewise stretch, a series of small min-max stretches are set up within a single histogram to enhance selected image data.
It will be noted that existing contrast enhancement algorithms associated with MPEG-2 compression are routinely performed after decoding the MPEG2 video streams. It will also be noted that the computational complexity of linear contrast enhancement algorithms is much higher in the spatial domain than if the same contrast enhancement algorithm is implemented in the compressed domain, i.e., the Discrete Cosine Transform (DCT) or frequency domain.
Researchers working in the area of image processing systems are continually searching for contrast enhancement methods having low computational complexity. For example, the paper entitled “Edge Enhancement of Remote Sensing Image Data in the DCT Domain,” (Transactions of Image and Vision Computing 17, pgs. 913-921 (1999)) by Chen et al. proposed a contrast enhancement algorithm in the DCT domain. However, the algorithm proposed by Chen et al. exhibits several problems when one attempts to employ the algorithm in MPEG-2 image processing including:    1. The algorithm employed by Chen et al. requires some information, e.g., the minimum and maximum luminance value for each single frame, from the decoded video stream. It will be appreciated that the requirement for post-decoding data makes this algorithm much less efficient and, thus, of a much higher computational complexity, than an algorithm that operates without spatial domain data.    2. Moreover, the Chen et al. algorithm also fails to discriminate between the two different type of DCT blocks, i.e., intra block (a DCT transform of a non-motion compensated block) and inter block (a DCT transform of the difference between the current block and the reference block(s)), that occur in the MPEG-2 encoded video stream. It should be noted that this will create annoying block artifacts in the final decoded pictures, i.e., the processing of the two different types of DCT compressed blocks in the same way will introduce errors into in the output image. Thus, the Chen et al. algorithm is not optimal for the processing of MPEG-2 video streams.    3. Finally, the Chen et al. algorithm attempts to expand the luminance range of the picture to fill all 256 possible levels in an eight bit data stream. It will be appreciated that this produces additional visible artifacts under some circumstance, e.g., when enhancing the contrast of an image of a dark scene. The Chen et al. algorithm would produce a bright image from a dark image, irrespective of the fact that the image is intentionally dark.
What is needed is an improved MPEG-2 decoder which contains an embedded contrast enhancement function. Preferably, the improved MPEG-2 decoder performs this contrast enhancement function entirely in the DCT domain. What is also needed is a novel linear contrast enhancement algorithm, which operates totally in the DCT domain. It would be desirable if the improved MPEG-2 decoder which contains an embedded contrast enhancement function operates at a relatively low computational complexity. It would also be desirable if the improved MPEG-2 decoder which contains an embedded contrast enhancement function were simple to implement in software and/or inexpensive to implement in hardware.